<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.hhxy.pojo.Brand" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="新增"><br>
<hr>
<table border="1" cellspacing="0" width="800">
    <tr>
        <th>序号</th>
        <th>品牌名称</th>
        <th>企业名称</th>
        <th>排序</th>
        <th>品牌介绍</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    <%--========================核心代码============================--%>
    <c:forEach items="${lists}" var="brand">
        <%--El表达式中对象的遍历需要搭配JSTL标签使用--%>
        <tr align="center">
            <td>${brand.id}</td>
            <td>${brand.brandName}</td>
            <td>${brand.companyName}</td>
            <td>${brand.ordered}</td>
            <td>${brand.description}</td>
            <td>${brand.status == 1 ? "启用":"禁用"}</td>
            <td><a href="#">修改</a> <a href="#">删除</a></td>
        </tr>
    </c:forEach>
<%--
   使用不同for循环的方式进行遍历
    <c:forEach begin="0" end="${lists.size()-1}" step="1" var="i">
        <tr align="center">
            <td>${lists[i].id}</td>
            <td>${lists[i].brandName}</td>
            <td>${lists[i].companyName}</td>
            <td>${lists[i].ordered}</td>
            <td>${lists[i].description}</td>
            <td>${lists[i].status == 1 ? "启用":"禁用"}</td>
            <td><a href="#">修改</a> <a href="#">删除</a></td>
        </tr>
    </c:forEach>
--%>

    <%--==========================================================--%>
</table>
</body>
</html>